package br.com.thecodebakers.ndk;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class Principal extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        String progBasic = "10 seton trace\n" +
        	"20 seton graus\n" +
        	"30 let x = 60\n" +
        	"40 let seno = sin(x)\n" +
        	"50 let coseno = cos(x)\n" +
        	"60 let tangente = tan(x)\n" +
        	"70 let arctan = atn(x)\n" +
        	"80 let absoluto = abs(-11)\n" +
        	"90 let expon = exp(10)\n" +
        	"100 let s = rnd()\n" +
        	"110 print s\n" +
        	"120 let z = rnd() * s";
        String saida = embedVersion(progBasic);
        TextView txt = (TextView) this.findViewById(R.id.txtsaida);
        txt.setText(saida);
    }
    
    private native String embedVersion(String codigo);
    
    static {
    	System.loadLibrary("ibasic");
    }
}